package com.wechat.order.controller.weChetAdminController;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by zzy on 2017/12/17.
 */
@RestController
@RequestMapping("/wc/verify/admin")
@Slf4j
public class weChetVerify {

    @GetMapping("/token")
    public String token(HttpServletRequest request){

        String signature=request.getParameter("signature");
        String timestamp=request.getParameter("timestamp");
        String nonce=request.getParameter("nonce");
        String echostr=request.getParameter("echostr");

        log.info("signature={},timestamp={},nonce={},echostr={}",signature,timestamp,nonce,echostr);
        return echostr;
    }


    public static void main(String[] args) {
        String a="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJwYXlsb2FkIjoie1wiaWRcIjoxLFwibmFtZVwiOlwiYWRtaW5cIixcInBhc3N3b3JkXCI6XCIyMTIzMmYyOTdhNTdhNWE3NDM4OTRhMGU0YTgwMWZjM1wiLFwicm9sZXNcIjpbe1wicm9sZUlkXCI6MSxcInJvbGVOYW1lXCI6XCJyb2xlVGVzdE9uZVwiLFwibWVudXNcIjpbe1wiaWRcIjoxLFwibmFtZVwiOlwiQVBJ5YiX6KGoXCIsXCJpc1BhcmVudFwiOjAsXCJpbmRleFVybFwiOlwiL3RvTWFpbnRhaW5BcGlcIixcImNyZWF0b3JcIjpcImFkbWluXCIsXCJjcmVhdGVUaW1lXCI6XCJKdW4gOCwgMjAxOCA0OjAyOjA2IFBNXCIsXCJ1cGRhdGVUaW1lXCI6XCJKdW4gOCwgMjAxOCA0OjAyOjEzIFBNXCIsXCJ1cGRhdGVyXCI6XCJhZG1pblwifSx7XCJpZFwiOjQsXCJuYW1lXCI6XCJBUFDljYfnuqdcIixcImlzUGFyZW50XCI6MCxcImluZGV4VXJsXCI6XCIvdG9VcGRhdGVMaXN0XCIsXCJjcmVhdG9yXCI6XCJhZG1pblwiLFwiY3JlYXRlVGltZVwiOlwiSn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